import request from '@/utils/request'
// 文章列表
export function article(query) {
  return request({
    url: '/article',
    method: 'get',
    params: query
  })
}
// 热门设置
export function changeSwitch(query) {
  return request({
    url: '/sethot',
    method: 'get',
    params: query
  })
}
// 获取指定文章
export function getArticleId(id) {
  return request({
    url: '/articlelist',
    method: 'get',
    params: { id }
  })
}
// 编辑文章
export function articleEdit(data) {
  return request({
    url: '/edit',
    method: 'get',
    params: data
  })
}

export function articleAdd(data) {
  return request({
    url: '/articleAdd',
    method: 'get',
    params: data
  })
}

export function delArticle(data) {
  return request({
    url: '/delArticle',
    method: 'post',
    data
  })
}
export function upload(data) {
  return request({
    url: '/upload',
    method: 'post',
    data
  })
}
